<style type="text/css">
span{
    overflow : hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-break: break-all;
}
</style>
<template>
  <yd-list theme="4">
      <yd-list-item v-for="answer in answers" :key="answer.id" type="link" :href="`Manswer?survey_no=${answer.survey_id.survey_no}`">
          <img slot="img" :src="answer.survey_id.cover_img">
          <span slot="title">{{ answer.survey_id.title }}</span>
          <yd-list-other slot="other">
              <div>
                  <span class="demo-list-price" v-html="answer.survey_id.desc"></span>
              </div>
          </yd-list-other>
      </yd-list-item>
  </yd-list>
</template>

<script>
import util from "@/libs/util";

export default {
  name: 'PcSurvey',
  data() {
    return {
    	data: {},
      limit: 10,
      answers: {}
    };
  },
	methods: {
		init(page) {
			util.ajax.get('/index/lists', { params: { page: page, limit: this.limit, user_id: 16} })
      .then(response => {
        if (response.code === 200) {
        	this.answers = response.data.lists
        }
      })
		}
	},
  mounted() {
  	this.data = this.$route.query
  	this.init(1)
	}
}
</script>
